﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.TeamFoundation.Client;
using System.IO;
using TfsGiggle.Core;

namespace TfsGiggle.ConsoleForPerformanceTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var cancelToken = new CancellationToken();
            var tfsConfigurationServer = TfsConfigurationServerFactoryImpl.GetConfigurationServer(new Uri("http://localhost:8080/tfs"));
            var _temporaryDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            JobManager.Instance.Open(_temporaryDir, tfsConfigurationServer, cancelToken);
            var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://localhost:8080/tfs/DefaultCollection"));
            JobManager.Instance.AddJob(tfs.InstanceId.ToString(), 170);
            Thread.Sleep(TimeSpan.FromMinutes(2));
            JobManager.Instance.Dispose();
            Directory.Delete(_temporaryDir, true);
        }
    }
}
